<template>

	<view class="main">
		<u-navbar :fixed="false" title="病历" @rightClick="rightClick" :autoBack="true"></u-navbar>

		<view class=" column_c">

			<view class="card-content" style="margin-top: 30rpx;">
				<view class="hzxx">基础信息</view>
				<u-line margin="30rpx 0 30rpx 0"></u-line>
				<view class="row_a_c space-between item-a">
					<text class="clinic">医生</text>
					<text class="status  center">{{infoData.doctor.name}}</text>
				</view>
				<view class="row_a_c space-between item-a">
					<text class="clinic">助理</text>
					<text class="status  center">{{infoData.assistant.name}}</text>
				</view>
				<view class="row_a_c space-between item-a">
					<text class="clinic">科室</text>
					<text class="status  center">{{infoData.territory.name}}</text>
				</view>
				<view class="row_a_c space-between item-a">
					<text class="clinic">就诊时间</text>
					<text class="status  center">{{infoData.created_at}}</text>
				</view>
				<view class="row_a_c space-between item-a">
					<text class="clinic">病历类型</text>
					<text class="status  center" style="color: #27CCBB;" v-if="infoData.type==1">初诊病历</text>
					<text class="status  center" style="color: #27CCBB;" v-if="infoData.type==2">复诊病历</text>
				</view>
			</view>

			<view class="card-content">
				<view class="hzxx">患者信息</view>
				<u-line margin="30rpx 0 30rpx 0"></u-line>
				<view class="item-a">
					<text class="clinic">主诉</text>
					<view class="shumin">
						{{infoData.chief_complaint}}
					</view>
				</view>
				<view class="item-a">
					<text class="clinic">现病史</text>
					<view class="shumin">
						{{infoData.current_medical_history}}
					</view>
				</view>
				<view class="item-a">
					<text class="clinic">既往史</text>
					<view class="shumin">
						{{infoData.past_medical_history}}
					</view>
				</view>
			</view>


			<view class="card-content">
				<view class="hzxx">诊断及治疗</view>
				<u-line margin="30rpx 0 30rpx 0"></u-line>
				<view class="item-a">
					<text class="clinic">诊断</text>
					<view class="shumin">
						{{infoData.diagnosis}}
					</view>
				</view>
				<view class="item-a">
					<text class="clinic">治疗计划</text>
					<view class="shumin">
						{{infoData.treatment}}
					</view>
				</view>
			</view>


			<view class="card-content">
				<view class="hzxx">医嘱</view>
				<u-line margin="30rpx 0 30rpx 0"></u-line>
				<view class="item-a">
					<text class="clinic">医嘱</text>
					<view class="shumin">
						{{infoData.enjoin}}
					</view>
				</view>
				<view class="item-a">
					<text class="clinic">备注</text>
					<view class="shumin">
						{{infoData.remark}}
					</view>
				</view>
			</view>

		</view>




	</view>

</template>

<script>
	import api_history from '@/api/history.js';

	export default {
		onLoad(options) {
			this.medical_record = options.id
		},

		async onShow() {
			this.getMedicaRecordlDetailFuc(); //病历详情
		},
		data() {
			return {
				medical_record: null,
				infoData: null,
			};
		},
		methods: {

			//病历详情
			async getMedicaRecordlDetailFuc() {
				var per = {
					medical_record: this.medical_record,
				}
				const res = await api_history.getMedicaRecordlDetail(per);
				if (res.code == 1) {
					this.infoData = res.data.info
				} else {
					this.$util.msg(res.message);
					return;
				}
			},

		}
	};
</script>

<style scoped lang="scss">
	.main {
		background: #FAFAFA;
		height: 100%;
	}


	.item-a {
		margin-bottom: 20rpx;
	}

	.time {
		font-weight: 400;
		font-size: 28rpx;
		color: #7F7F7F;
	}

	.card {
		background-color: #fff;
		border-radius: 8px;
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
		margin-bottom: 20px;
	}

	.status {
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.85);
	}

	.clinic {
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.6);
	}



	.card-content {
		width: 686rpx;
		min-height: 200rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 8rpx -2rpx rgba(0, 0, 0, 0.04), 0rpx 0rpx 10rpx 0rpx rgba(0, 0, 0, 0.03), 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.02);
		border-radius: 20rpx 20rpx 20rpx 20rpx;
		padding: 32rpx 32rpx 32rpx 32rpx;
		margin-bottom: 20rpx;

	}

	.time {
		font-weight: 400;
		font-size: 24rpx;
		color: rgba(0, 0, 0, 0.6);
		margin-bottom: 12rpx;
	}



	.hzxx {
		font-weight: 600;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.85);
	}



	.shumin {
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.85);
		margin-top: 8rpx;

	}
</style>